{% extends 'common/panel.html' %}
{% load currency %}
{% block title %}{{array.name}} Potential Impact Analysis{% endblock title %}
{% block panel %}
<h3>Commercial Potential Impact Analysis Report</h3>
<div class='freetext'>
<br>

    <!-- Estimated Annual Net Impact on Commercial Fisheries by Port (reduction in revenue)-->
    <table  style='width:450px' class='impact_analysis_container'>
        <thead>
            <tr>
                <th></th>
                <th><b>Potential Net Economic Impact</b> (2007 U.S. Dollars)</th>
                <th></th>
                <th><b>Potential Net Economic Impact</b> (% Net Revenue)</th>
            </tr>
        </thead>
        <tbody>
        {% for impact in port_impacts %}
            <tr class="{% cycle '' 'grey' %}">
                <td style="width: 165px;" class="species_name">{{ impact.port }}</td>
                <td>{{ impact.NEI|currency }}</td>
                <td></td>
                <td>{{ impact.percNEI|floatformat:'1' }}&nbsp;<small>%</small></td>
            </tr>
        {% endfor %}
        <tr class="{% cycle '' 'grey' %}">
            <td style="width: 165px;" class="species_name"><b>Entire Study Region</b></td>
            <td><b>{{ studyregion_impacts.NEI|currency }}</b></td>
            <td></td>
            <td><b>{{ studyregion_impacts.percNEI|floatformat:'1' }}&nbsp;<small>%</small></b></td>
        </tbody>
        </tbody>
    </table>
    <br>
    
    <!-- Estimated Annual Gross Impact on Commercial Fisheries by Port (reduction in revenue)-->
    <table  style='width:450px' class='impact_analysis_container'>
        <thead>
            <tr>
                <th></th>
                <th><b>Potential Gross Economic Impact</b> (2007 U.S. Dollars)</th>
                <th></th>
                <th><b>Potential Gross Economic Impact</b> (% Gross Revenue)</th>
            </tr>
        </thead>
        <tbody>
        {% for impact in port_impacts %}
            <tr class="{% cycle '' 'grey' %}">
                <td style="width: 165px;" class="species_name">{{ impact.port }}</td>
                <td>{{ impact.GEI|currency }}</td>
                <td></td>
                <td>{{ impact.percGEI|floatformat:'1' }}&nbsp;<small>%</small></td>
            </tr>
        {% endfor %}
        <tr class="{% cycle '' 'grey' %}">
            <td style="width: 165px;" class="species_name"><b>Entire Study Region</b></td>
            <td><b>{{ studyregion_impacts.GEI|currency }}</b></td>
            <td></td>
            <td><b>{{ studyregion_impacts.percGEI|floatformat:'1' }}&nbsp;<small>%</small></b></td>
        </tbody>
    </table>
    
    <!-- Estimated Annual Net Impact on Commercial Fisheries by Species (reduction in profit)-->
    <br>
    <table  style='width:450px' class='impact_analysis_container'>
        <thead>
            <tr>
                <th></th>
                <th><b>Potential Net Economic Impact</b> (2007 U.S. Dollars)</th>
                <th></th>
                <th><b>Potential Net Economic Impact</b> (% Net Revenue)</th>
            </tr>
        </thead>
        <tbody>
        {% for results in analysis_results %}
            <tr><td></td><td></td><td></td><td></td></tr>
            <tr>
                <td style="width: 165px;" class="species_name"><b>{{ results.0.port }}</b></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr><td></td><td></td><td></td><td></td></tr>
            {% for result in results %}
                <tr class="{% cycle '' 'grey' %}">
                    <td class="species_name">{{ result.species }}</td>
                    {% if result.NEI == '---' %}
                        <td>---</td>
                    {% else %}
                        <td>{{ result.NEI|currency }}</td>
                    {% endif %}
                    <td></td>
                    {% if result.percNEI == '---' %}
                        <td>---</td>
                    {% else %}
                        <td>{{ result.percNEI|floatformat:'1' }}&nbsp;<small>%</small></td>
                    {% endif %}
                </tr>
            {% endfor %}
        {% endfor %}
        </tbody>
    </table>

    <!-- Estimated Annual Gross Impact on Commercial Fisheries by Species (reduction in revenue)-->
    <br>
    <table  style='width:450px' class='impact_analysis_container'>
        <thead>
            <tr>
                <th></th>
                <th><b>Potential Gross Economic Impact</b> (2007 U.S. Dollars)</th>
                <th></th>
                <th><b>Potential Gross Economic Impact</b> (% Gross Revenue)</th>
            </tr>
        </thead>
        <tbody>
        {% for results in analysis_results %}
            <tr><td></td><td></td><td></td><td></td></tr>
            <tr>
                <td style="width: 165px;" class="species_name"><b>{{ results.0.port }}</b></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr><td></td><td></td><td></td><td></td></tr>
            {% for result in results %}
                <tr class="{% cycle '' 'grey' %}">
                    <td class="species_name">{{ result.species }}</td>
                    {% if result.GEI == '---' %}
                        <td>---</td>
                    {% else %}
                        <td>{{ result.GEI|currency }}</td>
                    {% endif %}
                    <td></td>
                    {% if result.percGEI == '---' %}
                        <td>---</td>
                    {% else %}
                        <td>{{ result.percGEI|floatformat:'1' }}&nbsp;<small>%</small></td>
                    {% endif %}
                </tr>
            {% endfor %}
        {% endfor %}
        </tbody>
    </table>

</div>
<br>
<div style='font-size: small'><a target='_blank' href='{% url array_printable_analysis array.id "com" %}'>View Printable Report</a></div>
<br>
{% endblock panel %}
